package com.example.demo.strategy;

import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.style.AbstractCellStyleStrategy;
import org.apache.poi.ss.usermodel.*;

public class CustomContentStyleStrategy extends AbstractCellStyleStrategy {

    @Override
    protected void setContentCellStyle(Cell cell, Head head, Integer relativeRowIndex) {
        CellStyle cellStyle = new CellStyle() {
            @Override
            public short getIndex() {
                return 0;
            }

            @Override
            public void setDataFormat(short i) {

            }

            @Override
            public short getDataFormat() {
                return 0;
            }

            @Override
            public String getDataFormatString() {
                return null;
            }

            @Override
            public void setFont(Font font) {
                font.setFontName("宋体");
            }

            @Override
            public short getFontIndex() {
                return 0;
            }

            @Override
            public int getFontIndexAsInt() {
                return 0;
            }

            @Override
            public void setHidden(boolean b) {

            }

            @Override
            public boolean getHidden() {
                return false;
            }

            @Override
            public void setLocked(boolean b) {

            }

            @Override
            public boolean getLocked() {
                return false;
            }

            @Override
            public void setQuotePrefixed(boolean b) {

            }

            @Override
            public boolean getQuotePrefixed() {
                return false;
            }

            @Override
            public void setAlignment(HorizontalAlignment horizontalAlignment) {

            }

            @Override
            public HorizontalAlignment getAlignment() {
                return null;
            }

            @Override
            public HorizontalAlignment getAlignmentEnum() {
                return null;
            }

            @Override
            public void setWrapText(boolean b) {

            }

            @Override
            public boolean getWrapText() {
                return false;
            }

            @Override
            public void setVerticalAlignment(VerticalAlignment verticalAlignment) {

            }

            @Override
            public VerticalAlignment getVerticalAlignment() {
                return null;
            }

            @Override
            public VerticalAlignment getVerticalAlignmentEnum() {
                return null;
            }

            @Override
            public void setRotation(short i) {

            }

            @Override
            public short getRotation() {
                return 0;
            }

            @Override
            public void setIndention(short i) {

            }

            @Override
            public short getIndention() {
                return 0;
            }

            @Override
            public void setBorderLeft(BorderStyle borderStyle) {

            }

            @Override
            public BorderStyle getBorderLeft() {
                return null;
            }

            @Override
            public BorderStyle getBorderLeftEnum() {
                return null;
            }

            @Override
            public void setBorderRight(BorderStyle borderStyle) {

            }

            @Override
            public BorderStyle getBorderRight() {
                return null;
            }

            @Override
            public BorderStyle getBorderRightEnum() {
                return null;
            }

            @Override
            public void setBorderTop(BorderStyle borderStyle) {

            }

            @Override
            public BorderStyle getBorderTop() {
                return null;
            }

            @Override
            public BorderStyle getBorderTopEnum() {
                return null;
            }

            @Override
            public void setBorderBottom(BorderStyle borderStyle) {

            }

            @Override
            public BorderStyle getBorderBottom() {
                return null;
            }

            @Override
            public BorderStyle getBorderBottomEnum() {
                return null;
            }

            @Override
            public void setLeftBorderColor(short i) {

            }

            @Override
            public short getLeftBorderColor() {
                return 0;
            }

            @Override
            public void setRightBorderColor(short i) {

            }

            @Override
            public short getRightBorderColor() {
                return 0;
            }

            @Override
            public void setTopBorderColor(short i) {

            }

            @Override
            public short getTopBorderColor() {
                return 0;
            }

            @Override
            public void setBottomBorderColor(short i) {

            }

            @Override
            public short getBottomBorderColor() {
                return 0;
            }

            @Override
            public void setFillPattern(FillPatternType fillPatternType) {

            }

            @Override
            public FillPatternType getFillPattern() {
                return null;
            }

            @Override
            public FillPatternType getFillPatternEnum() {
                return null;
            }

            @Override
            public void setFillBackgroundColor(short i) {

            }

            @Override
            public short getFillBackgroundColor() {
                return 0;
            }

            @Override
            public Color getFillBackgroundColorColor() {
                return null;
            }

            @Override
            public void setFillForegroundColor(short i) {

            }

            @Override
            public short getFillForegroundColor() {
                return 0;
            }

            @Override
            public Color getFillForegroundColorColor() {
                return null;
            }

            @Override
            public void cloneStyleFrom(CellStyle cellStyle) {

            }

            @Override
            public void setShrinkToFit(boolean b) {

            }

            @Override
            public boolean getShrinkToFit() {
                return false;
            }
        };
        cell.setCellStyle(cellStyle);
        super.setContentCellStyle(cell, head, relativeRowIndex);
    }
}